{if $listing->data|@count > 1}
<p>
	Sort by
	<select>
		{foreach from=$listing->columnsSettings key='columnSettingsKey' item='columnSettings'}
		{if $columnSettings.sortable}
		<option onclick="sortBy('{$listing->listing_name}', '{$columnSettingsKey}', 'ASC')" {if $columnSettingsKey == $listing->sortByColumn && $listing->sortByDirection == 'ASC'}selected="selected"{/if} value="{$columnSettingsKey}">{$columnSettings.title} (ASC)</option>
		<option onclick="sortBy('{$listing->listing_name}', '{$columnSettingsKey}', 'DESC')" {if $columnSettingsKey == $listing->sortByColumn && $listing->sortByDirection == 'DESC'}selected="selected"{/if} value="{$columnSettingsKey}">{$columnSettings.title} (DESC)</option>
		{/if}
		{/foreach}
	</select>
	<input type="button" value="OK" />
</p>
{/if}
<p>
	Filter :
	<input type="text" onkeyup="filterThisField(_getClassAttribute('JS_ATTR_', $(this).parent().parent()), $(this).next().val(), $(this).val());" value="{if $listing->filterValue != ''}{$listing->filterValue}{else}Filter...{/if}" onfocus="if (this.value == 'Filter...') this.value = '';" onblur="if (this.value == '') this.value = 'Filter...';"/> on
	<select onchange="filterThisField(_getClassAttribute('JS_ATTR_', $(this).parent().parent()), $(this).val(), $(this).previous().val());">
		<option value="">---</option>
		{foreach from=$listing->columnsSettings key='columnSettingsKey' item='columnSettings'}
		{if $columnSettings.filterable}
		<option value="{$columnSettingsKey}" {if $columnSettingsKey == $listing->filterColumn}selected="selected"{/if}>{$columnSettings.title}</option>
		{/if}
		{/foreach}
	</select>
	<input class="clear_filter" type="button" onclick="return clearThisFilter(_getClassAttribute('JS_ATTR_', $(this).parent().parent()));" value="Clear the filter" />
</p>
<ul class="listing listing_content {if $listing->type == 'list2'}listing2{/if}">
	{foreach from=$listing->data item='item'}
		{include file='listing_list_item.tpl'}
	{/foreach}
</ul>
<br class="clear" />
{if $listing->data|@count == 0}
<p>No item found.</p>
{/if}
